package cn.zwx.common.rocket.producer.listener;

import cn.zwx.common.rocket.consumer.bo.ConsumerListenerBO;
import cn.zwx.common.rocket.consumer.enums.ReturnCodeEnum;
import cn.zwx.common.rocket.consumer.listener.ConsumerListener;
import cn.zwx.common.rocket.producer.service.DefaultConsumerService;

public class DefaultConsumerListener implements ConsumerListener {

    @Override
    public String apply(ConsumerListenerBO consumerListenerBO) {
        String topic = consumerListenerBO.getTopic();
        DefaultConsumerService defaultConsumerService = DefaultConsumerService.consumerMap.get(topic);
        defaultConsumerService.process(consumerListenerBO);
        return ReturnCodeEnum.SUCCESS.getCode();
    }
}
